{% load static %}
<!doctype html>
<html lang="en">

<head>
    <title>EasyTest - 接口自动化测试平台</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <!-- VENDOR CSS -->
    <link rel="stylesheet" href="{% static 'css/index.css' %}">
    <link rel="stylesheet" href="{% static 'css/all.min.css' %}">
    <link rel="stylesheet" href="{% static 'css/bootstrap.css' %}">
    <link rel="stylesheet" href="{% static 'font-awesome-4.7.0/css/font-awesome.min.css' %}">
    <!-- MAIN CSS -->
    <link rel="stylesheet" href="{% static 'css/main.css' %}">
    <!-- FOR DEMO PURPOSES ONLY. You should remove this in your project -->
    <link rel="stylesheet" href="{% static 'css/demo.css' %}">
    <link rel="stylesheet" href="{% static 'css/loading.css' %}">
    <!-- GOOGLE FONTS -->
    {#    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700" rel="stylesheet">#}
    <!-- ICONS -->
    <link rel="apple-touch-icon" sizes="76x76" href="{% static 'img/favicon.png' %}">
    <link rel="icon" type="image/png" sizes="96x96" href="{% static 'img/favicon.png' %}">
    <style type="text/css">
        body {
            background-image: "{% static 'img/bg.svg' %}";
            background-color: #F3F5F8;
        }

        #particles-js {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: -1;
        }

        #sidebar-nav .sidebar-scroll nav li {
            border-bottom: 1px solid rgba(107, 108, 109, 0.19);
        }

        .breadcrumb {
            background-color: transparent;
        }

        .breadcrumb li a {
            color: #777777;
            font-size: 18px;
            font-weight: 600;
        }

        .navbar .nav > li .dropdown-menu {
            margin: 0;
        }

        .navbar .nav > li:hover .dropdown-menu {
            display: block;
        }
    </style>
    {% block css %}{% endblock %}

</head>

<body>
<!-- WRAPPER -->
<div id="wrapper">
    <!-- NAVBAR -->
    <nav class="navbar navbar-default navbar-fixed-top">
        <div class="brand">
            <a href="{% url 'index' %}"><img src="{% static 'img/logo.png' %}" alt="Klorofil Logo"
                                             class="img-responsive logo"></a>
        </div>
        <div class="container-fluid">
            <div class="navbar-btn">
                <button type="button" class="btn-toggle-fullwidth"><i class="fa fa-arrow-left"></i></button>
            </div>
            <div id="navbar-menu1">
                <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown" onclick="select_ul()">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown"><img
                                src="{% static 'img/userImg.jpeg' %}"
                                class="img-circle" alt="Avatar">
                            <span>{{ user }}</span> <i class="icon-submenu fa fa-caret-down"></i></a>
                        <ul class="dropdown-menu">
                            <li><a href="javascript:void(0)" onclick="changePassword()"><i
                                    class="fa fa-minus-square"></i> <span>修改密码</span></a>
                            </li>
                            <li><a href="https://email.163.com/" target="_blank"><i class="fa fa-envelope-open"></i>
                                <span>163邮箱</span></a></li>
                            <li><a href="/admin/"><i class="fa fa-bookmark"></i> <span>管理后台</span></a></li>
                            <li><a href="{% url 'guest:event_manage' %}"><i
                                    class="fa fa-mouse-pointer"></i> <span>demo页面</span></a>
                            </li>
                            <li><a href="{% url 'mocks:mock_api' %}"><i
                                    class="fa fa-pinterest-square"></i> <span>Mocks服务</span></a>
                            </li>
                            {#                            <li><a href="http://www.easytest.xyz:8080" target="_blank"><i#}
                            {#                                    class="fa fa-rocket"></i> <span>jenkins部署</span></a>#}
                            {#                            </li>#}
                            <li><a href="http://www.easytest.xyz:8889/index" target="_blank"><i
                                    class="fa fa-compass"></i> <span>宝塔监控</span></a>
                            </li>
                            <li><a href="https://github.com/lixiaofeng1993/EasyTest" target="_blank"><i
                                    class="fa fa-github"></i> <span>Github地址</span></a>
                            </li>
                            <li><a href="https://www.cnblogs.com/changqing8023" target="_blank"><i
                                    class="fa fa-rouble"></i> <span>博客园地址</span></a>
                            </li>
                            <li><a href="{% url 'logout' %}"><i class="fa fa-sign-out"></i> <span>退出</span></a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <div id="sidebar-nav" class="sidebar">
        <div class="sidebar-scroll">
            <nav>
                <ul class="nav" style="margin-top: 15px">
                    <li><a href="{% url 'index' %}" class=""><i class="fa fa-home"></i> <span
                            style="margin-left: 0">主页</span></a></li>
                    <li>
                        {% block nav %}

                        {% endblock %}
                        {#                    <li><a href="{% url 'base:project' %}" class=""><i class="fa fa-product-hunt fa-fw"></i>项目管理</a>#}
                        {#                    </li>#}
                        {#                    <li><a href="{% url 'base:env' %}" class=""><i class="fa fa-envira fa-fw"></i>测试环境</a>#}
                        {#                    </li>#}
                        {#                    <li><a href="{% url 'base:interface' %}" class=""><i#}
                        {#                            class="fa fa-pinterest-square fa-fw"></i>接口管理</a>#}
                        {#                    </li>#}
                        {#                    <li><a href="{% url 'base:case' %}" class=""><i class="fa fa-suitcase fa-fw"></i>用例管理</a>#}
                        {#                    </li>#}
                        {#                    <li><a href="{% url 'base:plan' %}" class=""><i class="fa fa-book fa-fw"></i>测试计划</a>#}
                        {#                    </li>#}
                        {#                    <li><a href="{% url 'base:task_index' %}" class=""><i class="fa fa-tasks fa-fw"></i>定时任务</a>#}
                        {#                    </li>#}
                        {#                    <li><a href="{% url 'base:report_page' %}" class=""><i class="fa fa-bar-chart fa-fw"></i>运行报告</a>#}
                        {#                    </li>#}
                        {#                    <li><a href="{% url 'base:performance' %}" class=""><i class="fa fa-book fa-fw"></i>性能测试</a>#}
                        {#                    <li><a href="{% url 'base:sign' %}" class=""><i class="fa fa-pencil fa-fw"></i>签名方式</a>#}
                        {#                    </li>#}
                        {#                    <li><a href="{% url 'base:user' %}" class=""><i class="fa fa-user fa-fw"></i>用户管理</a>#}
                        {#                    </li>#}
                        {#                    <li><a href="{% url 'base:about' %}" class=""> <i class="fa fa-cog fa-cab"></i> 关于我们</a></li>#}
                </ul>
            </nav>
        </div>
    </div>
    <!-- END LEFT SIDEBAR -->
    <!-- MAIN -->
    <div class="main">
        <div class="main-content">
            <div class="container-fluid">
                {% block crumbs %}
                {% endblock %}
                {% block body %}
                {% endblock %}
            </div>
        </div>
    </div>

</div>

<div id="particles-js"></div>

<script src="{% static 'jquery/jquery.min.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
<script src="{% static 'js/jquery.slimscroll.min.js' %}"></script>
<script src="{% static 'js/klorofil-common.js' %}"></script>
<script type="application/javascript" src="{% static 'js/particles.js' %}"></script>
<script type="application/javascript" src="{% static 'js/app.js' %}"></script>
<script>
    $(document).ready(function () {
        var a_name = $("a").text();

        var page_name = $("a.this-page").text();
        console.log(page_name);
        if (a_name) {
            $("span:contains(" + a_name + ")").parent('a').removeClass("collapsed");
            $("span:contains(" + a_name + ")").parent('a').addClass("active");
            if (page_name) {
                $("a:contains(" + page_name + ")").parent('li').parent('ul').parent('div').removeClass("collapse");
                $("a:contains(" + page_name + ")").parent('li').parent('ul').parent('div').addClass("collapse in");
                $("a:contains(" + page_name + ")").addClass("active");
            }
        }
    });
    function changePassword() {
        var new_password = prompt('新密码');
        $.ajax({
            type: "post",
            url: "/change_password/",
            data: {
                "new_password": new_password
            },
            success: function (data) {
                if (new_password) {
                    if (data['msg'] == 'success') {
                        alert('修改密码成功！');
                        window.location.replace("/login_action/");
                    } else {
                        alert(data['msg'])
                    }
                } else if (new_password == '') {
                    alert('密码不能为空！')
                } else {
                    // 点击取消按钮
                }

            }
        })
    }
    function select_ul() {
        console.log(1);
        $(".dropdown").attr("class", "dropdown open");
        $("#img").attr("aria-expanded", "true");
    }

</script>

{% block javascript %} {% endblock %}
</body>

</html>
